package de.lusiardi.webdav.xml;

import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAnyElement;
import javax.xml.bind.annotation.XmlRootElement;

/**
 * http://www.webdav.org/specs/rfc4918.html#ELEMENT_prop
 *
 * @author Joachim Lusiardi
 */
@XmlRootElement
@XmlAccessorType(value = XmlAccessType.FIELD)
public class Prop extends AlternativePropnamePropAllprop {

    @XmlAnyElement(lax = true)
    private List<Object> properties;

    public List<Object> getProperties() {
        return properties;
    }

    public void setProperties(List<Object> properties) {
        this.properties = properties;
    }

    public void addProperty(Object property) {
        if (properties == null) {
            properties = new ArrayList<Object>();
        }
        properties.add(property);
    }

    @Override
    public String returnType() {
        return PROP;
    }
}
